Repository navigation
fix(plugin-dashboard): a viewer whose every tile is refused sees one no-access panel, not a blank canvas - #27777
Merged
Conversation
…no-access panel Each refused dataset tile is still left out for the viewer. When that leaves nothing to draw, the canvas shows one no-access panel in the face the console uses for a refused dashboard, instead of the header over an empty grid. Partial refusals, design mode and non-refusal failures are unchanged. Adds dashboard.allWidgetsForbiddenMessage in ten locales. Claude-Session: https://claude.ai/code/session_01Utp6CXTsLkvW2GpvDwNQre Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#2 · os-bill · session_01Utp6CY2n1JmZZKrHgtp9jC 席位核对ACCEPT · head
Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
domain:ui#2 · os-bill · session_01Utp6CY2n1JmZZKrHgtp9jC
Requested by Bill · project thread
Fixes #27491
Clause-②: no
Metadata-protocol: none
维护者速读
ui/packages/plugin-dashboard/src/DashboardRenderer.tsx(nothingLeftForViewer与allTilesRefusedPanel,桌面和移动两处挂载)→ 新测试DashboardRenderer.allTilesRefused-27491.test.tsx→ui/packages/i18n/src/locales/en.ts新键。pnpm --dir ui exec vitest run packages/plugin-dashboard/src/__tests__/DashboardRenderer.allTilesRefused-27491.test.tsx,预期 5/5 通过。What changes
Outside design mode, a dataset tile whose query the server refuses as a read refusal is left out of the dashboard for that viewer (the rule the spec states in the dashboard widget docblock). When that leaves nothing to draw, the viewer saw the dashboard header over an empty canvas, with no message. Ruling-ref: 6508997538 (maintainer ruling A).
DashboardRendererrenders its tiles once per layout (desktopTiles;metricTilesandotherTilesin the mobile stack) and asksnothingLeftForViewer(tiles): not design mode, at least one refused tile, at least one widget, and every rendered tile isnull. The onlynulla tile renders is the refusal drop, so the trigger is exactly "every widget was left out as refused". A dashboard that still has any drawable widget (a non-dataset widget, a readable tile, a tile that failed for another reason) draws it and no panel.Emptycomposition the console draws for a dashboard the viewer may not open (dashboard-access-deniedinDashboardView): lock icon, titledashboard.widgetForbiddenTitle, and one new messagedashboard.allWidgetsForbiddenMessage. It carriesdata-testid="dashboard-all-widgets-forbidden"and spans the full grid (col-span-full). The header, its description and the refresh control are untouched.@object-ui/i18n:dashboard.allWidgetsForbiddenMessagein all ten locales, besidewidgetForbiddenMessage. en: "You don’t have permission to view the data behind this dashboard." (the typographic apostrophe the neighbouringdashboard.*strings use).Tests
New
ui/packages/plugin-dashboard/src/__tests__/DashboardRenderer.allTilesRefused-27491.test.tsx(5 tests), with the refusal shapeAnalyticsForbiddenErrorcarries (httpStatus: 403,code: 'PERMISSION_DENIED'):DashboardRenderer.refusedTile-26971.test.tsxandDatasetWidget.forbiddenState-10899.test.tsxpass unchanged.Readings
examples/app-crmpipeline_dashboardthrough the realObjectStackAdapterwith fetch answering 403PERMISSION_DENIEDrendered an empty canvas; ablating the refusal drop brought the six frames back. Scratch test, never committed.scripts/ablation-replace.mjson commit 76be307: the trigger'stiles.length > 0 && tiles.every((tile) => tile == null)replaced byfalse(anchor 1 → 0, blob c9adcbb0354a → eb6c069cbd78): the two all-refused tests red, the three others green (2 failed / 3 passed); restored, blob == HEAD c9adcbb0354a,git diff HEADempty. The test imports the renderer by relative path, so no dist leg.main(head 24bc0b9), closurepnpm --filter '@object-ui/plugin-dashboard^...' buildVERDICT command-exit 0;pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-dashboard/ packages/i18n/: Test Files 286 passed (286), Tests 3266 passed, 19 skipped; lock VERDICT command-exit 0.Acceptance notes
requiredPermissionsonpipeline_dashboardand its nav item) is a separate app-lane card, not this PR.Verification
pnpm --dir ui exec vitest run packages/plugin-dashboard/src/__tests__/DashboardRenderer.allTilesRefused-27491.test.tsx packages/plugin-dashboard/src/__tests__/DashboardRenderer.refusedTile-26971.test.tsx packages/plugin-dashboard/src/__tests__/DatasetWidget.forbiddenState-10899.test.tsx→ 3 files, 11 tests passed.🤖 Generated with Claude Code
https://claude.ai/code/session_01Utp6CXTsLkvW2GpvDwNQre
Generated by Claude Code